/**
 * Created by Eric.Dou on 4/15/14.
 */
define(function (require) {
    var comm = require('lib/commons');
    return function (helper, $) {
        helper.register('addEventListenerfunction', function (options) {
            this.condition = function (opt) {
                if (comm.hasPro(options, 'lazyLoad')) {
                    if (options['lazyLoad']) {
                        return false;
                    }
                }
                if (!comm.hasPro(options, 'listener')) {
                    return false;
                }
                return true;
            };
            var listener = options['listener'];
            if ($.isFunction(listener)) {
                listener($);
            }
            return   {'addEventListenerfunction': true}
        });
    }

});